﻿using System;
using System.Net;
using System.Windows;

using System.Windows.Input;


namespace G.Net
{
    public class ParamPair : IComparable<ParamPair>
    {
        public ParamPair()
        { }

        public ParamPair(string name, string value)
        {
            this.Name = name;
            this.Value = value;
        }


        public string Name { get; set; }


        public string Value { get; set; }


        public int CompareTo(ParamPair other)
        {
            if (null == this.Name)
            {
                if (null == other.Name)
                {
                    if (null == this.Value)
                        return null == other.Value ? 0 : -1;
                    else
                        return null == other.Value ? 1 : this.Value.CompareTo(other.Value);
                }
                else
                    return -1;
            }
            else
            {
                var equal = this.Name.CompareTo(other.Name);

                if (0 == equal)
                    equal = this.Value.CompareTo(other.Value);

                return equal;
            }
        }
    }

}
